<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - LandPPT</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            margin: 0;
            padding: 0;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .login-container {
            background: white;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }
        
        .logo {
            text-align: center;
            margin-bottom: 2rem;
        }
        
        .logo h1 {
            color: #333;
            margin: 0;
            font-size: 2rem;
            font-weight: 600;
        }
        
        .logo p {
            color: #666;
            margin: 0.5rem 0 0 0;
            font-size: 0.9rem;
        }
        
        #supertokens-root {
            /* SuperTokens components will be rendered here */
        }
        
        .powered-by {
            text-align: center;
            margin-top: 2rem;
            color: #666;
            font-size: 0.8rem;
        }
        
        .powered-by a {
            color: #667eea;
            text-decoration: none;
        }
        
        .powered-by a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="logo">
            <h1>LandPPT</h1>
            <p>AI驱动的PPT生成平台</p>
        </div>
        
        <!-- SuperTokens UI will be rendered here -->
        <div id="supertokens-root"></div>
        
        <div class="powered-by">
            Powered by <a href="https://supertokens.com" target="_blank">SuperTokens</a>
        </div>
    </div>

    <!-- SuperTokens Frontend SDK -->
    <script src="https://cdn.jsdelivr.net/npm/supertokens-web-js/bundle/supertokens.js"></script>
    <script>
        // Initialize SuperTokens frontend
        supertokens.init({
            appInfo: {
                appName: "yzs-ppt",
                apiDomain: "{{ supertokens_api_domain }}",
                websiteDomain: "{{ supertokens_website_domain }}"
            },
            recipeList: [
                supertokens.Session.init(),
                supertokens.EmailPassword.init()
            ]
        });

        // Handle successful login
        supertokens.redirectToAuth({
            redirectBack: false,
            onSuccess: function() {
                window.location.href = "/dashboard";
            }
        });
    </script>
</body>
</html>
